﻿Imports EnvDTE
'Imports EnvDTE80
'Imports EnvDTE90

Imports System.Diagnostics
Imports System.Text.RegularExpressions
Imports System.Text
Imports System.Collections.Generic

'Imports EnvDTE80

Public Module Csharp
    '2008.02.25 v2.2:迁移至 vs2008 上使用。

    Sub EnableDebug()
        '2006.01.05 v1.0 将代码更改为只限于条件编译代码。
        DTE.UndoContext.Open("久永宏：使用条件编译(Debug)")

        'DTE.ExecuteCommand("Edit.CommentSelection", )
        'DTE.ExecuteCommand("Edit.UncommentSelection")
        Dim t As TextSelection = DTE.ActiveDocument.Selection
        t.Insert("#if DEBUG " & vbCrLf & t.Text & "#else " & vbCrLf, vsInsertFlags.vsInsertFlagsContainNewText Or vsInsertFlags.vsInsertFlagsInsertAtStart)
        t.Insert("#endif //DEBUG [" & Date.Now.ToString() & "]" & vbCrLf, vsInsertFlags.vsInsertFlagsContainNewText Or vsInsertFlags.vsInsertFlagsInsertAtEnd) '& vbCrLf

        't.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn)
        't.EndOfLine()
        't.NewLine()

        DTE.UndoContext.Close()
    End Sub

    Sub Disable()
        '2005.12.12 v1.0 将不用的代码段标记并折叠
        '2009.04.15 v1.0 修正编译标记的取值错误。
        Static Tag As String = String.Empty
        If Tag = String.Empty Then
            Tag = InputBox("请输入编译标记：", DefaultResponse:="AllEnable")
        Else
            Tag = InputBox("请输入编译标记：", DefaultResponse:=Tag)
        End If
        Dim d As String = Date.Now.ToString()
        Dim st As TextSelection = DTE.ActiveDocument.Selection
        Dim s As String = InputBox("请填写禁用此段代码的原因：", DefaultResponse:="更改为自定义的实现")
        DTE.UndoContext.Open("久永宏：禁用代码段")
        st.AnchorPoint.CreateEditPoint().Insert("#if " & Tag & " //久永[" & d & "] 目的：（" + s + "）" & vbCrLf) ', vsInsertFlags.vsInsertFlagsInsertAtStart
        st.BottomPoint.CreateEditPoint().Insert("#endif //久永[" & d & "]" & vbCrLf) ', vsInsertFlags.vsInsertFlagsInsertAtEnd
        DTE.UndoContext.Close()

    End Sub

    Sub MarkEdit()
        '2005.12.11 v1.0 将自己需要或者已经编辑的代码段标记并折叠。
        '2008.06.16 v1.5 更好、更强大！
        '2008.12.24 v2.0 更改没有源代码的方式为添加标记。
        Dim d As String = Date.Now.ToString()
        Static woken = "已改动代码"
        Dim work As String = InputBox("输入标记说明", "久永代码机器人", woken)
        woken = work

        Randomize()
        Dim count As String = (Microsoft.VisualBasic.VBMath.Rnd() * 10000).ToString("0000")
        '模版
        '#region 作者：久永 时间：[2008-6-16 10:59:22](ID:7055) 目的：（原设计会在控件设计时出错。） 
        '//Jiuyong: 原设计会在控件设计时出错。[2008-6-16 10:59:22]

        '#endregion 久永[2008-6-16 10:59:22](ID:7055)

        DTE.UndoContext.Open("久永宏：插入开始编辑标记：" & work)
        'st.Insert("#region 作者：久永 时间：[" & d & "](ID:" & count & ") 目的：（" & work & "） " + vbCrLf + "//Jiuyong: " & work & "[" & d & "]" & vbCrLf, vsInsertFlags.vsInsertFlagsInsertAtStart)
        'st.Insert(vbCrLf & "#endregion 久永[" & d & "](ID:" & count & ")" & vbCrLf, vsInsertFlags.vsInsertFlagsInsertAtEnd)
        Dim code As String = DTE.ActiveDocument.Selection.Text
        DTE.ExecuteCommand("Edit.CommentSelection")
        Dim st As TextSelection = DTE.ActiveDocument.Selection
        Dim text As String = st.Text
        Dim sb As StringBuilder = New StringBuilder()
        Dim format As String
        If String.IsNullOrEmpty(text) Then
            DTE.ActiveDocument.Selection.EndOfLine()
            format = "//Jiuyong:↓目的：（{2}）作者：久永 时间：[{3}](ID:{1})↓{0}{0}//Jiuyong:↑目的：（{2}）作者：久永 时间：[{3}](ID:{1})↑{0}"
        Else
            format = "#region ///↓作者：久永 时间：[{3}](ID:{1}) 目的：（{2}） {0}//Jiuyong: {2}[{3}]{0}//原文：{0}{4}{0}//改为：{0}#endregion 久永[{3}](ID:{1}){0}{5}{0}///↑作者：久永 时间：[{3}](ID:{1}) 目的：（{2}） {0}"
        End If
        sb.AppendFormat(format, vbCrLf, count, work, d, text, code)
        st.Insert(sb.ToString(), vsInsertFlags.vsInsertFlagsContainNewText)
        DTE.UndoContext.Close()

    End Sub

    Sub Refactor()
        '2004.06.26 v1.0:可以选中的字段定义行代码自动重构为同名属性并作相应更改（符合dotNet库命名规则）。
        '2004.06.26 v1.0:声明语句必须是在单行语句。
        '2004.06.26 v1.0:对于一个字母的字段重构不再报错。
        '2005.11.27 v1.1:现在数组类型已可以正确识别。
        '2006.09.25 v1.1:类型定义声明中必须不存在空格等非单词字母。

        '2006.09.25 v2.0:现在可以正确匹配字段带赋值的情况。
        '2006.10.10 v2.1:对于不能重构的行，现在输出将保持其原样不再删除。
        '2007.01.31 v2.2:现在可以正确匹配泛型类型。
        '2007.04.05 v2.2:现在生成的代码有更加合理的格式输出，XML注释等现在输出在原来所在的位置。
        '2008.04.01 v2.3:现在对于“可空（Nullable）”类型提供支持。
        '2008.07.03 v2.4:对于非ASCII字符（如：汉字）的变量名效果正常。
        '2008.08.06 v2.5:现在支持多类型参数的泛型类型。
        '2009.03.15 v2.6:现在属性的“可写”代码默认是被注释掉的。
        '2009.06.28 v2.7:现在提供对多维数组类型的定义。
		'2010.05.18 v2.8:自动默认添加  INotifyPropertyChanged 接口的更改通知。
		'2010.07.15 v2.9:将不常用的引发通知更改调用多加一层注释，以方便开启属性的写功能。

        'ToDo           :1。静态修饰符 static 会在重构时丢失！ 
        '               :2。XML 文档注释是否要根据原有的访问级别来放置？
        '               :3。多类型参数的泛型要保持参数间没有空白。
        '               :4。对于赋值的语句，如果赋值的值的代码中包括语句（例如包含在字符串值中的脚本语言源代码），
        '                   应特别注意，并在使用后检查是否和预期的结果一致。

        Dim line, originalCode, vars As String

        If DTE.ActiveDocument Is Nothing Then Return

        Dim txt As TextSelection
        txt = CType(DTE.ActiveDocument.Selection, TextSelection)
        originalCode = txt.Text
        Dim variableName As String
        Dim publicName As String
        Dim privateName As String
        Dim dataType As String
        Dim varValue As String
        Dim propertyProcedures As New System.Text.StringBuilder
        Dim lines() As String
        lines = Split(originalCode, vbLf)
        Dim r As Regex
        '"\s*(?<typename>[\w.\<\,\>\?]+(\[\,*])?)\s*(?<varname>\w+)\s*((?<varvalue>=[^\;]*))?\;", _
        r = New Regex( _
         "\s*(?<typename>\w+\S*)\s*(?<varname>\w+)\s*((?<varvalue>=[^\;]*))?\;", _
         RegexOptions.IgnoreCase Or _
         RegexOptions.ExplicitCapture)

        vars = String.Empty
        For Each line In lines
            'line = line.Trim 'Jiuyong@v2.1
            If Not line = String.Empty Then

                'If line.Length = 1 Then
                '    MsgBox("变量名" & line & "太短，建议更改！")
                '    Exit For
                'End If

                Dim mtch As Match
                mtch = r.Match(line)
                If mtch.Success Then
                    variableName = _
                      mtch.Groups("varname").Value.Trim
                    If vars = String.Empty Then
                        vars = variableName
                    Else
                        vars = vars & "," & variableName
                    End If
                    dataType = _
                      mtch.Groups("typename").Value.Trim
                    varValue = (mtch.Groups("varvalue").Value.Trim())

                    'variableName = IIf(variableName.StartsWith("_"), variableName.Substring(1), variableName)
                    'variableName = IIf(variableName.StartsWith("m_"), variableName.Substring(2), variableName) 
                    '当variableName只有一个字母时，发生不必要的计算，产生错误,所以改为以下运算：
                    If (variableName.StartsWith("_")) Then
                        variableName = variableName.Substring(1)
                    End If
                    If (variableName.StartsWith("m_")) Then
                        variableName = variableName.Substring(2)
                    End If

                    publicName = variableName.Substring(0, 1).ToUpper() & variableName.Substring(1)
                    privateName = "_" & variableName.Substring(0, 1).ToLower() & variableName.Substring(1)

					propertyProcedures.AppendFormat("" _
					& "		private {1} {2}{3};" & vbCrLf _
					& "		public {1} {0}" & vbCrLf _
					& "		{{" & vbCrLf _
					& "			get" & vbCrLf _
					& "			{{" & vbCrLf _
					& "				return {2};" & vbCrLf _
					& "			}}" & vbCrLf _
					& "" & vbCrLf _
					& "			//set" & vbCrLf _
					& "			//{{" & vbCrLf _
					& "			//	{2} = value;" & vbCrLf _
					& "			////	OnPropertyChanged(""{0}"");" & vbCrLf _
					& "			//}}" & vbCrLf _
					& "		}}" & vbCrLf & vbCrLf, _
					  publicName, _
					  dataType, privateName, varValue)
                Else
                    propertyProcedures.Append(line) 'v2.1
                    'MsgBox(String.Format("此行‘{0}’中未检测到可重构的代码，已跳过！", line)) v2.3 -> 过多的用户交互。
                End If
            End If
        Next

        DTE.UndoContext.Open("久永宏：重构属性[" & vars & "]")
        txt = CType(DTE.ActiveDocument.Selection, TextSelection)
        txt.Delete()
        txt.Insert(propertyProcedures.ToString) 'vsInsertFlags.vsInsertFlagsContainNewText Or , _        vsInsertFlags.vsInsertFlagsInsertAtStart()
        'txt.Text = propertyProcedures.ToString '被过多格式化。
        'txt.Text = propertyProcedures.ToString()
        txt.SmartFormat()
        DTE.UndoContext.Close()

    End Sub

    Function WpfRefactor()
        '2004.06.26 v1.0:可以选中的字段定义行代码自动重构为同名属性并作相应更改（符合dotNet库命名规则）。
        '2004.06.26 v1.0:声明语句必须是在单行语句。
        '2004.06.26 v1.0:对于一个字母的字段重构不再报错。
        '2005.11.27 v1.1:现在数组类型已可以正确识别。
        '2006.09.25 v1.1:类型定义声明中必须不存在空格等非单词字母。

        '2006.09.25 v2.0:现在可以正确匹配字段带赋值的情况。
        '2006.10.10 v2.1:对于不能重构的行，现在输出将保持其原样不再删除。
        '2007.01.31 v2.2:现在可以正确匹配泛型类型。
        '2007.04.05 v2.2:现在生成的代码有更加合理的格式输出，XML注释等现在输出在原来所在的位置。
        '2008.04.01 v2.3:现在对于“可空（Nullable）”类型提供支持。
        '2008.07.03 v2.4:对于非ASCII字符（如：汉字）的变量名效果正常。
        '2008.08.06 v2.5:现在支持多类型参数的泛型类型。
        '2009.03.15 v2.6:现在属性的“可写”代码默认是被注释掉的。

        ' v3.0:将字段重构为依赖项属性。
        ' 不一定完成，可能会使用 代码段 功能代替。
        ' 如果完成，会将 Function 更改为 Sub。

        'ToDo           :1。静态修饰符 static 会在重构时丢失！ 
        '               :2。XML 文档注释是否要根据原有的访问级别来放置？
        '               :3。多类型参数的泛型要保持参数间没有空白。
        '               :4。对于赋值的语句，如果赋值的值的代码中包括语句（例如包含在字符串值中的脚本语言源代码），
        '                   应特别注意，并在使用后检查是否和预期的结果一致。

        Dim line, originalCode, vars As String

        If DTE.ActiveDocument Is Nothing Then Return Nothing

        Dim txt As TextSelection
        txt = CType(DTE.ActiveDocument.Selection, TextSelection)
        originalCode = txt.Text
        Dim variableName As String
        Dim publicName As String
        Dim privateName As String
        Dim dataType As String
        Dim varValue As String
        Dim propertyProcedures As New System.Text.StringBuilder
        Dim lines() As String
        lines = Split(originalCode, vbLf)
        Dim r As Regex
        r = New Regex( _
         "\s*(?<typename>[\w.\<\,\>\?]+(\[])?)\s*(?<varname>\w+)\s*((?<varvalue>=[^\;]*))?\;", _
         RegexOptions.IgnoreCase Or _
         RegexOptions.ExplicitCapture)

        vars = String.Empty
        For Each line In lines
            'line = line.Trim 'Jiuyong@v2.1
            If Not line = String.Empty Then

                'If line.Length = 1 Then
                '    MsgBox("变量名" & line & "太短，建议更改！")
                '    Exit For
                'End If

                Dim mtch As Match
                mtch = r.Match(line)
                If mtch.Success Then
                    variableName = _
                      mtch.Groups("varname").Value.Trim
                    If vars = String.Empty Then
                        vars = variableName
                    Else
                        vars = vars & "," & variableName
                    End If
                    dataType = _
                      mtch.Groups("typename").Value.Trim
                    varValue = (mtch.Groups("varvalue").Value.Trim())

                    'variableName = IIf(variableName.StartsWith("_"), variableName.Substring(1), variableName)
                    'variableName = IIf(variableName.StartsWith("m_"), variableName.Substring(2), variableName) 
                    '当variableName只有一个字母时，发生不必要的计算，产生错误,所以改为以下运算：
                    If (variableName.StartsWith("_")) Then
                        variableName = variableName.Substring(1)
                    End If
                    If (variableName.StartsWith("m_")) Then
                        variableName = variableName.Substring(2)
                    End If

                    publicName = variableName.Substring(0, 1).ToUpper() & variableName.Substring(1)
                    privateName = "_" & variableName.Substring(0, 1).ToLower() & variableName.Substring(1)

                    propertyProcedures.AppendFormat("" _
                    & "		private {1} {2}{3};" & vbCrLf _
                    & "		public {1} {0}" & vbCrLf _
                    & "		{{" & vbCrLf _
                    & "			get" & vbCrLf _
                    & "			{{" & vbCrLf _
                    & "				return {2};" & vbCrLf _
                    & "			}}" & vbCrLf _
                    & "" & vbCrLf _
                    & "			//set" & vbCrLf _
                    & "			//{{" & vbCrLf _
                    & "			//	{2} = value;" & vbCrLf _
                    & "			//}}" & vbCrLf _
                    & "		}}" & vbCrLf & vbCrLf, _
                      publicName, _
                      dataType, privateName, varValue)
                Else
                    propertyProcedures.Append(line) 'v2.1
                    'MsgBox(String.Format("此行‘{0}’中未检测到可重构的代码，已跳过！", line)) v2.3 -> 过多的用户交互。
                End If
            End If
        Next

        DTE.UndoContext.Open("久永宏：重构属性[" & vars & "]")
        txt = CType(DTE.ActiveDocument.Selection, TextSelection)
        txt.Delete()
        txt.Insert(propertyProcedures.ToString) 'vsInsertFlags.vsInsertFlagsContainNewText Or , _        vsInsertFlags.vsInsertFlagsInsertAtStart()
        'txt.Text = propertyProcedures.ToString '被过多格式化。
        'txt.Text = propertyProcedures.ToString()
        txt.SmartFormat()
        DTE.UndoContext.Close()



    End Function

    Sub ToVbCodeBuilder()
        '2005.12.11 v1.0: 将选中的代码装换为vb宏输出脚本到剪贴板

        Dim line, originalCode, vars As String

        If DTE.ActiveDocument Is Nothing Then Return

        Dim txt As TextSelection
        txt = CType(DTE.ActiveDocument.Selection, TextSelection)
        originalCode = txt.Text
        Dim lines() As String
        lines = Split(originalCode, vbLf)

        '1
        Dim CodeStringBuilder As New System.Text.StringBuilder
        CodeStringBuilder.Append(vbCrLf)
        CodeStringBuilder.AppendFormat("Dim CodeStringBuilder As New System.Text.StringBuilder")
        CodeStringBuilder.Append(vbCrLf)

        For i As Integer = 0 To lines.Length - 1
            CodeStringBuilder.AppendFormat("CodeStringBuilder.Append(vbCrLf)")
            CodeStringBuilder.Append(vbCrLf)
            line = lines(i).Replace("""", """""").Replace("{", "{{").Replace("}", "}}").Replace(vbCr, "").Replace(vbLf, "")
            CodeStringBuilder.AppendFormat("CodeStringBuilder.AppendFormat(""{0}"")", line)
            CodeStringBuilder.Append(vbCrLf)
        Next

        CodeStringBuilder.Append(vbCrLf)

        DTE.UndoContext.Open("久永宏：提取为宏输出（计：" & lines.Length.ToString() & "行）")
        txt.EndOfLine()
        'txt.NewLine(2)
        txt.Insert(CodeStringBuilder.ToString(), _
        vsInsertFlags.vsInsertFlagsContainNewText Or vsInsertFlags.vsInsertFlagsInsertAtEnd)
        txt.Cut()
        DTE.UndoContext.Close()

    End Sub

    Function JscriptBuilder()
        '2007.01.31 v0.5: 将选中的代码装换为jscript脚本的输出脚本到剪贴板(未完成)

        Dim line, originalCode, vars As String

        If DTE.ActiveDocument Is Nothing Then Return Nothing

        Dim txt As TextSelection
        txt = CType(DTE.ActiveDocument.Selection, TextSelection)
        originalCode = txt.Text
        Dim lines() As String
        lines = Split(originalCode, vbLf)

        '1
        Dim CodeStringBuilder As New System.Text.StringBuilder
        CodeStringBuilder.Append(vbCrLf)
        CodeStringBuilder.AppendFormat("Dim CodeStringBuilder As New System.Text.StringBuilder")
        CodeStringBuilder.Append(vbCrLf)

        For i As Integer = 0 To lines.Length - 1
            CodeStringBuilder.AppendFormat("CodeStringBuilder.Append(vbCrLf)")
            CodeStringBuilder.Append(vbCrLf)
            line = lines(i).Replace("""", """""").Replace("{", "{{").Replace("}", "}}").Replace(vbCr, "").Replace(vbLf, "")
            CodeStringBuilder.AppendFormat("CodeStringBuilder.AppendFormat(""{0}"")", line)
            CodeStringBuilder.Append(vbCrLf)
        Next

        CodeStringBuilder.Append(vbCrLf)

        DTE.UndoContext.Open("久永宏：提取为宏输出（计：" & lines.Length.ToString() & "行）")
        txt.EndOfLine()
        'txt.NewLine(2)
        txt.Insert(CodeStringBuilder.ToString(), _
        vsInsertFlags.vsInsertFlagsContainNewText Or vsInsertFlags.vsInsertFlagsInsertAtEnd)
        txt.Cut()
        DTE.UndoContext.Close()

    End Function

    Function ProfilerString()
        '2004.04.13 v0.0: 混淆输出的字符串

        '***********************************************************************
        '一种新的思路：对字符串进行编码处理，求其字符串
        '然后对编码后的字符串进行字符处理
        '然后对处理后的字符串解码成乱码
        '以byte[]方式在源代码中存储其数据

        '解码的时候反序进行，并且只要混淆的过程有可逆操作既可
        '在源代码处就地生成处理函数，并随上下文生成符合环境的随机函数代码。
        '这样，即使反编译到代码，也很难在其中查找到关键字符串。
        '***********************************************************************

    End Function

    Sub EvaluationExchange()
        '2008.03.29 v1.0:将“=”的左右交换。
        'TODO:更大范围上的数据程式应用，不但是等于号。

        If DTE.ActiveDocument Is Nothing Then Return

        Dim txt As TextSelection
        Dim r As Regex
        r = New Regex( _
         "(?<sp>\s*)(?<var>[^=]+)\s*=\s*(?<value>[^=;]+)\s*\;", _
         RegexOptions.IgnoreCase Or _
         RegexOptions.ExplicitCapture)

        DTE.UndoContext.Open("久永宏：交换赋值")
        txt = CType(DTE.ActiveDocument.Selection, TextSelection)
        txt.Text = r.Replace(txt.Text, "${sp}${value}=${var};")
        'txt.SmartFormat()
        DTE.UndoContext.Close()



    End Sub

    Sub RemoveBlankLine()
        '2008.04.01 v1.0:消除多个空行。

        'If DTE.ActiveDocument Is Nothing Then Return

        'Dim txt As TextSelection
        'Dim r As Regex
        'r = New Regex( _
        ' "(?<name>[\r\n]+)", _
        ' RegexOptions.IgnoreCase Or _
        ' RegexOptions.ExplicitCapture)

        DTE.UndoContext.Open("久永宏：消除空行")
        'txt = CType(DTE.ActiveDocument.Selection, TextSelection)
        'txt.DeleteWhitespace(vsWhitespaceOptions.vsWhitespaceOptionsHorizontal Or vsWhitespaceOptions.vsWhitespaceOptionsVertical)
        DTE.ActiveDocument.Selection.DeleteWhitespace(vsWhitespaceOptions.vsWhitespaceOptionsVertical)
        'txt.Text = r.Replace(txt.Text, vbCrLf)
        'txt.SmartFormat()
        DTE.UndoContext.Close()
    End Sub

    Sub CommentToTemplet()
        '2008.06.06 v1.0 将注释转化为字符串表达式语句。
        Dim comment As String
        Dim text As String
        Dim csharp As String = String.Empty
        Dim templet As String = "{1}//原文：{1}{2}{1}//模版：{1}string normTemplet = @""{1}{0}"";"
        If TypeOf (DTE.ActiveDocument.Selection) Is TextSelection Then
            '取
            Dim textSelect As TextSelection = DTE.ActiveDocument.Selection
            text = textSelect.Text
            DTE.UndoContext.Open("久永宏：从注释生成文本模版")
            DTE.ExecuteCommand("Edit.UncommentSelection")
            comment = textSelect.Text
            DTE.ExecuteCommand("Edit.CommentSelection")
            Dim sb As StringBuilder = New StringBuilder(comment)
            '转
            sb.Replace("""", """""")
            'sb.AppendLine()
            'sb.Insert(0, vbCrLf)
            csharp = String.Format(templet, sb.ToString(), vbCrLf, text)
            '出
            textSelect.Insert(csharp, vsInsertFlags.vsInsertFlagsContainNewText) '.vsInsertFlagsInsertAtEnd
            DTE.UndoContext.Close()
        Else
            Return
        End If


    End Sub

    Sub Pinyin()

        '将选中汉字转化为拼音首字母。
        '2008.06.25 v1.0 将选中汉字转化为拼音首字母。
        Dim text As String = DTE.ActiveDocument.Selection.Text
        Dim c, y As Char

        Static pyd As StringBuilder = New StringBuilder("ABCDEFGHJKLMNOPQRSTWXYZ")  '字母表 。
        Static hzd As StringBuilder = New StringBuilder("啊芭擦搭蛾发噶骸肌喀馈谩拿哦啪期然撒塌挖昔摇匝") '汉字表（起点字符）。

        Dim hzm As List(Of Integer) = New List(Of Integer)
        For Each c In hzd.ToString().ToCharArray()
            hzm.Add(Asc(c))
        Next

        Dim r As StringBuilder = New StringBuilder() '转换好的字符。

        For Each ch As Char In text
            Dim j As Integer = 0

            '找到位置
            For i As Integer = 0 To hzd.Length - 1

                Dim s1 As String = Asc(ch)
                Dim s2 As String = Asc(hzd(i))
                If Asc(ch) >= Asc(hzd(i)) Then
                Else
                    j = i - 1
                    Exit For
                End If

            Next

            '取得字母
            If j < 0 Or j >= hzd.Length Then
                y = ch
            Else
                y = pyd(j)
            End If

            r.Append(y)
        Next

        DTE.UndoContext.Open("久永宏：将汉字转化为拼音首字母")
        DTE.ActiveDocument.Selection.Text = r.ToString()
        DTE.UndoContext.Close()

    End Sub
	Sub INotifyPropertyChanged()
		'2010.05.26 v0.9 为类、结构添加 属性通知接口。
		'2010.11.15 v1.0 添加自动验证属性重载。
		'2010.11.16 v1.1 添加方法的完整注释。

		Dim I As TextSelection = DTE.ActiveDocument.Selection
		'DTE.UndoContext.Open("久永宏：添加属性通知接口方法 OnPropertyChanged")
        I.Insert(vbCrLf & _
        "/// <summary>" & vbCrLf & _
        "/// 发生属性更改后，通知订阅者。" & vbCrLf & _
        "/// </summary>" & vbCrLf & _
        "/// <param name=""propertyName"">更改的属性名称。</param>" & vbCrLf & _
        "protected void OnPropertyChanged(string propertyName)" & vbCrLf & _
        "{" & vbCrLf & _
        "	if (PropertyChanged != null)" & vbCrLf & _
        "	{" & vbCrLf & _
        "		PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));" & vbCrLf & _
        "	}" & vbCrLf & _
        "}" & vbCrLf & _
        "" & vbCrLf & _
        "/// <summary>" & vbCrLf & _
        "/// 发生属性更改后，通知订阅者，并自动验证属性是否符合附加校验特性性。" & vbCrLf & _
        "/// </summary>" & vbCrLf & _
        "/// <param name=""propertyName"">需要校验的属性名称。</param>" & vbCrLf & _
        "/// <param name=""validateValue"">对应属性的值(对于在属性内部，直接填写 value 关键字即可)。</param>" & vbCrLf & _
        "protected void OnPropertyChanged(string propertyName, object validateValue)" & vbCrLf & _
        "{" & vbCrLf & _
        "	Validator.ValidateProperty(validateValue, new ValidationContext(this, null, null)" & vbCrLf & _
        "	{" & vbCrLf & _
        "		MemberName = propertyName" & vbCrLf & _
        "	});" & vbCrLf & _
        "	OnPropertyChanged(propertyName);" & vbCrLf & _
        "}" & vbCrLf & _
        "" & vbCrLf, vsInsertFlags.vsInsertFlagsContainNewText)
		DTE.ExecuteCommand("Edit.FormatSelection")
		DTE.ActiveDocument.Selection.EndOfLine()
		'DTE.UndoContext.Close()
	End Sub
    Public PingyinDictionary As System.Collections.Generic.Dictionary(Of String, Integer)
    'Function g(ByVal num As Integer)
    '    If num > 0 And num < 160 Then
    '        g = Chr(num)
    '    Else
    '        If num < -20319 Or num > -10247 Then
    '            g = ""
    '        Else
    '            Dim a As Dictionary(Of String, Integer).ValueCollection = PingyinDictionary.Values
    '            Dim b As Dictionary(Of String, Integer).KeyCollection = PingyinDictionary.Keys
    '            For Each i as In a
    '                If (i <= num) Then
    '                    Exit For
    '                End If
    '            Next
    '            g = PingyinDictionary
    '        End If
    '    End If
    'End Function

    'Function GetStringPingyin(ByVal text As String)
    '    GetStringPingyin = ""
    '    For i = 1 To Len(text)
    '        GetStringPingyin = GetStringPingyin & Mid(g(Asc(Mid(text, i, 1))), 1, 1)
    '    Next
    'End Function


    'Function GetPinyinDictionary() As Dictionary(Of String, Integer)

    '    If PingyinDictionary Is Nothing Then
    '        PingyinDictionary = New Dictionary(Of String, Integer)



    '        PingyinDictionary.Add("a", -20319)
    '        PingyinDictionary.Add("ai", -20317)
    '        PingyinDictionary.Add("an", -20304)
    '        PingyinDictionary.Add("ang", -20295)
    '        PingyinDictionary.Add("ao", -20292)
    '        PingyinDictionary.Add("ba", -20283)
    '        PingyinDictionary.Add("bai", -20265)
    '        PingyinDictionary.Add("ban", -20257)
    '        PingyinDictionary.Add("bang", -20242)
    '        PingyinDictionary.Add("bao", -20230)
    '        PingyinDictionary.Add("bei", -20051)
    '        PingyinDictionary.Add("ben", -20036)
    '        PingyinDictionary.Add("beng", -20032)
    '        PingyinDictionary.Add("bi", -20026)
    '        PingyinDictionary.Add("bian", -20002)
    '        PingyinDictionary.Add("biao", -19990)
    '        PingyinDictionary.Add("bie", -19986)
    '        PingyinDictionary.Add("bin", -19982)
    '        PingyinDictionary.Add("bing", -19976)
    '        PingyinDictionary.Add("bo", -19805)
    '        PingyinDictionary.Add("bu", -19784)
    '        PingyinDictionary.Add("ca", -19775)
    '        PingyinDictionary.Add("cai", -19774)
    '        PingyinDictionary.Add("can", -19763)
    '        PingyinDictionary.Add("cang", -19756)
    '        PingyinDictionary.Add("cao", -19751)
    '        PingyinDictionary.Add("ce", -19746)
    '        PingyinDictionary.Add("ceng", -19741)
    '        PingyinDictionary.Add("cha", -19739)
    '        PingyinDictionary.Add("chai", -19728)
    '        PingyinDictionary.Add("chan", -19725)
    '        PingyinDictionary.Add("chang", -19715)
    '        PingyinDictionary.Add("chao", -19540)
    '        PingyinDictionary.Add("che", -19531)
    '        PingyinDictionary.Add("chen", -19525)
    '        PingyinDictionary.Add("cheng", -19515)
    '        PingyinDictionary.Add("chi", -19500)
    '        PingyinDictionary.Add("chong", -19484)
    '        PingyinDictionary.Add("chou", -19479)
    '        PingyinDictionary.Add("chu", -19467)
    '        PingyinDictionary.Add("chuai", -19289)
    '        PingyinDictionary.Add("chuan", -19288)
    '        PingyinDictionary.Add("chuang", -19281)
    '        PingyinDictionary.Add("chui", -19275)
    '        PingyinDictionary.Add("chun", -19270)
    '        PingyinDictionary.Add("chuo", -19263)
    '        PingyinDictionary.Add("ci", -19261)
    '        PingyinDictionary.Add("cong", -19249)
    '        PingyinDictionary.Add("cou", -19243)
    '        PingyinDictionary.Add("cu", -19242)
    '        PingyinDictionary.Add("cuan", -19238)
    '        PingyinDictionary.Add("cui", -19235)
    '        PingyinDictionary.Add("cun", -19227)
    '        PingyinDictionary.Add("cuo", -19224)
    '        PingyinDictionary.Add("da", -19218)
    '        PingyinDictionary.Add("dai", -19212)
    '        PingyinDictionary.Add("dan", -19038)
    '        PingyinDictionary.Add("dang", -19023)
    '        PingyinDictionary.Add("dao", -19018)
    '        PingyinDictionary.Add("de", -19006)
    '        PingyinDictionary.Add("deng", -19003)
    '        PingyinDictionary.Add("di", -18996)
    '        PingyinDictionary.Add("dian", -18977)
    '        PingyinDictionary.Add("diao", -18961)
    '        PingyinDictionary.Add("die", -18952)
    '        PingyinDictionary.Add("ding", -18783)
    '        PingyinDictionary.Add("diu", -18774)
    '        PingyinDictionary.Add("dong", -18773)
    '        PingyinDictionary.Add("dou", -18763)
    '        PingyinDictionary.Add("du", -18756)
    '        PingyinDictionary.Add("duan", -18741)
    '        PingyinDictionary.Add("dui", -18735)
    '        PingyinDictionary.Add("dun", -18731)
    '        PingyinDictionary.Add("duo", -18722)
    '        PingyinDictionary.Add("e", -18710)
    '        PingyinDictionary.Add("en", -18697)
    '        PingyinDictionary.Add("er", -18696)
    '        PingyinDictionary.Add("fa", -18526)
    '        PingyinDictionary.Add("fan", -18518)
    '        PingyinDictionary.Add("fang", -18501)
    '        PingyinDictionary.Add("fei", -18490)
    '        PingyinDictionary.Add("fen", -18478)
    '        PingyinDictionary.Add("feng", -18463)
    '        PingyinDictionary.Add("fo", -18448)
    '        PingyinDictionary.Add("fou", -18447)
    '        PingyinDictionary.Add("fu", -18446)
    '        PingyinDictionary.Add("ga", -18239)
    '        PingyinDictionary.Add("gai", -18237)
    '        PingyinDictionary.Add("gan", -18231)
    '        PingyinDictionary.Add("gang", -18220)
    '        PingyinDictionary.Add("gao", -18211)
    '        PingyinDictionary.Add("ge", -18201)
    '        PingyinDictionary.Add("gei", -18184)
    '        PingyinDictionary.Add("gen", -18183)
    '        PingyinDictionary.Add("geng", -18181)
    '        PingyinDictionary.Add("gong", -18012)
    '        PingyinDictionary.Add("gou", -17997)
    '        PingyinDictionary.Add("gu", -17988)
    '        PingyinDictionary.Add("gua", -17970)
    '        PingyinDictionary.Add("guai", -17964)
    '        PingyinDictionary.Add("guan", -17961)
    '        PingyinDictionary.Add("guang", -17950)
    '        PingyinDictionary.Add("gui", -17947)
    '        PingyinDictionary.Add("gun", -17931)
    '        PingyinDictionary.Add("guo", -17928)
    '        PingyinDictionary.Add("ha", -17922)
    '        PingyinDictionary.Add("hai", -17759)
    '        PingyinDictionary.Add("han", -17752)
    '        PingyinDictionary.Add("hang", -17733)
    '        PingyinDictionary.Add("hao", -17730)
    '        PingyinDictionary.Add("he", -17721)
    '        PingyinDictionary.Add("hei", -17703)
    '        PingyinDictionary.Add("hen", -17701)
    '        PingyinDictionary.Add("heng", -17697)
    '        PingyinDictionary.Add("hong", -17692)
    '        PingyinDictionary.Add("hou", -17683)
    '        PingyinDictionary.Add("hu", -17676)
    '        PingyinDictionary.Add("hua", -17496)
    '        PingyinDictionary.Add("huai", -17487)
    '        PingyinDictionary.Add("huan", -17482)
    '        PingyinDictionary.Add("huang", -17468)
    '        PingyinDictionary.Add("hui", -17454)
    '        PingyinDictionary.Add("hun", -17433)
    '        PingyinDictionary.Add("huo", -17427)
    '        PingyinDictionary.Add("ji", -17417)
    '        PingyinDictionary.Add("jia", -17202)
    '        PingyinDictionary.Add("jian", -17185)
    '        PingyinDictionary.Add("jiang", -16983)
    '        PingyinDictionary.Add("jiao", -16970)
    '        PingyinDictionary.Add("jie", -16942)
    '        PingyinDictionary.Add("jin", -16915)
    '        PingyinDictionary.Add("jing", -16733)
    '        PingyinDictionary.Add("jiong", -16708)
    '        PingyinDictionary.Add("jiu", -16706)
    '        PingyinDictionary.Add("ju", -16689)
    '        PingyinDictionary.Add("juan", -16664)
    '        PingyinDictionary.Add("jue", -16657)
    '        PingyinDictionary.Add("jun", -16647)
    '        PingyinDictionary.Add("ka", -16474)
    '        PingyinDictionary.Add("kai", -16470)
    '        PingyinDictionary.Add("kan", -16465)
    '        PingyinDictionary.Add("kang", -16459)
    '        PingyinDictionary.Add("kao", -16452)
    '        PingyinDictionary.Add("ke", -16448)
    '        PingyinDictionary.Add("ken", -16433)
    '        PingyinDictionary.Add("keng", -16429)
    '        PingyinDictionary.Add("kong", -16427)
    '        PingyinDictionary.Add("kou", -16423)
    '        PingyinDictionary.Add("ku", -16419)
    '        PingyinDictionary.Add("kua", -16412)
    '        PingyinDictionary.Add("kuai", -16407)
    '        PingyinDictionary.Add("kuan", -16403)
    '        PingyinDictionary.Add("kuang", -16401)
    '        PingyinDictionary.Add("kui", -16393)
    '        PingyinDictionary.Add("kun", -16220)
    '        PingyinDictionary.Add("kuo", -16216)
    '        PingyinDictionary.Add("la", -16212)
    '        PingyinDictionary.Add("lai", -16205)
    '        PingyinDictionary.Add("lan", -16202)
    '        PingyinDictionary.Add("lang", -16187)
    '        PingyinDictionary.Add("lao", -16180)
    '        PingyinDictionary.Add("le", -16171)
    '        PingyinDictionary.Add("lei", -16169)
    '        PingyinDictionary.Add("leng", -16158)
    '        PingyinDictionary.Add("li", -16155)
    '        PingyinDictionary.Add("lia", -15959)
    '        PingyinDictionary.Add("lian", -15958)
    '        PingyinDictionary.Add("liang", -15944)
    '        PingyinDictionary.Add("liao", -15933)
    '        PingyinDictionary.Add("lie", -15920)
    '        PingyinDictionary.Add("lin", -15915)
    '        PingyinDictionary.Add("ling", -15903)
    '        PingyinDictionary.Add("liu", -15889)
    '        PingyinDictionary.Add("long", -15878)
    '        PingyinDictionary.Add("lou", -15707)
    '        PingyinDictionary.Add("lu", -15701)
    '        PingyinDictionary.Add("lv", -15681)
    '        PingyinDictionary.Add("luan", -15667)
    '        PingyinDictionary.Add("lue", -15661)
    '        PingyinDictionary.Add("lun", -15659)
    '        PingyinDictionary.Add("luo", -15652)
    '        PingyinDictionary.Add("ma", -15640)
    '        PingyinDictionary.Add("mai", -15631)
    '        PingyinDictionary.Add("man", -15625)
    '        PingyinDictionary.Add("mang", -15454)
    '        PingyinDictionary.Add("mao", -15448)
    '        PingyinDictionary.Add("me", -15436)
    '        PingyinDictionary.Add("mei", -15435)
    '        PingyinDictionary.Add("men", -15419)
    '        PingyinDictionary.Add("meng", -15416)
    '        PingyinDictionary.Add("mi", -15408)
    '        PingyinDictionary.Add("mian", -15394)
    '        PingyinDictionary.Add("miao", -15385)
    '        PingyinDictionary.Add("mie", -15377)
    '        PingyinDictionary.Add("min", -15375)
    '        PingyinDictionary.Add("ming", -15369)
    '        PingyinDictionary.Add("miu", -15363)
    '        PingyinDictionary.Add("mo", -15362)
    '        PingyinDictionary.Add("mou", -15183)
    '        PingyinDictionary.Add("mu", -15180)
    '        PingyinDictionary.Add("na", -15165)
    '        PingyinDictionary.Add("nai", -15158)
    '        PingyinDictionary.Add("nan", -15153)
    '        PingyinDictionary.Add("nang", -15150)
    '        PingyinDictionary.Add("nao", -15149)
    '        PingyinDictionary.Add("ne", -15144)
    '        PingyinDictionary.Add("nei", -15143)
    '        PingyinDictionary.Add("nen", -15141)
    '        PingyinDictionary.Add("neng", -15140)
    '        PingyinDictionary.Add("ni", -15139)
    '        PingyinDictionary.Add("nian", -15128)
    '        PingyinDictionary.Add("niang", -15121)
    '        PingyinDictionary.Add("niao", -15119)
    '        PingyinDictionary.Add("nie", -15117)
    '        PingyinDictionary.Add("nin", -15110)
    '        PingyinDictionary.Add("ning", -15109)
    '        PingyinDictionary.Add("niu", -14941)
    '        PingyinDictionary.Add("nong", -14937)
    '        PingyinDictionary.Add("nu", -14933)
    '        PingyinDictionary.Add("nv", -14930)
    '        PingyinDictionary.Add("nuan", -14929)
    '        PingyinDictionary.Add("nue", -14928)
    '        PingyinDictionary.Add("nuo", -14926)
    '        PingyinDictionary.Add("o", -14922)
    '        PingyinDictionary.Add("ou", -14921)
    '        PingyinDictionary.Add("pa", -14914)
    '        PingyinDictionary.Add("pai", -14908)
    '        PingyinDictionary.Add("pan", -14902)
    '        PingyinDictionary.Add("pang", -14894)
    '        PingyinDictionary.Add("pao", -14889)
    '        PingyinDictionary.Add("pei", -14882)
    '        PingyinDictionary.Add("pen", -14873)
    '        PingyinDictionary.Add("peng", -14871)
    '        PingyinDictionary.Add("pi", -14857)
    '        PingyinDictionary.Add("pian", -14678)
    '        PingyinDictionary.Add("piao", -14674)
    '        PingyinDictionary.Add("pie", -14670)
    '        PingyinDictionary.Add("pin", -14668)
    '        PingyinDictionary.Add("ping", -14663)
    '        PingyinDictionary.Add("po", -14654)
    '        PingyinDictionary.Add("pu", -14645)
    '        PingyinDictionary.Add("qi", -14630)
    '        PingyinDictionary.Add("qia", -14594)
    '        PingyinDictionary.Add("qian", -14429)
    '        PingyinDictionary.Add("qiang", -14407)
    '        PingyinDictionary.Add("qiao", -14399)
    '        PingyinDictionary.Add("qie", -14384)
    '        PingyinDictionary.Add("qin", -14379)
    '        PingyinDictionary.Add("qing", -14368)
    '        PingyinDictionary.Add("qiong", -14355)
    '        PingyinDictionary.Add("qiu", -14353)
    '        PingyinDictionary.Add("qu", -14345)
    '        PingyinDictionary.Add("quan", -14170)
    '        PingyinDictionary.Add("que", -14159)
    '        PingyinDictionary.Add("qun", -14151)
    '        PingyinDictionary.Add("ran", -14149)
    '        PingyinDictionary.Add("rang", -14145)
    '        PingyinDictionary.Add("rao", -14140)
    '        PingyinDictionary.Add("re", -14137)
    '        PingyinDictionary.Add("ren", -14135)
    '        PingyinDictionary.Add("reng", -14125)
    '        PingyinDictionary.Add("ri", -14123)
    '        PingyinDictionary.Add("rong", -14122)
    '        PingyinDictionary.Add("rou", -14112)
    '        PingyinDictionary.Add("ru", -14109)
    '        PingyinDictionary.Add("ruan", -14099)
    '        PingyinDictionary.Add("rui", -14097)
    '        PingyinDictionary.Add("run", -14094)
    '        PingyinDictionary.Add("ruo", -14092)
    '        PingyinDictionary.Add("sa", -14090)
    '        PingyinDictionary.Add("sai", -14087)
    '        PingyinDictionary.Add("san", -14083)
    '        PingyinDictionary.Add("sang", -13917)
    '        PingyinDictionary.Add("sao", -13914)
    '        PingyinDictionary.Add("se", -13910)
    '        PingyinDictionary.Add("sen", -13907)
    '        PingyinDictionary.Add("seng", -13906)
    '        PingyinDictionary.Add("sha", -13905)
    '        PingyinDictionary.Add("shai", -13896)
    '        PingyinDictionary.Add("shan", -13894)
    '        PingyinDictionary.Add("shang", -13878)
    '        PingyinDictionary.Add("shao", -13870)
    '        PingyinDictionary.Add("she", -13859)
    '        PingyinDictionary.Add("shen", -13847)
    '        PingyinDictionary.Add("sheng", -13831)
    '        PingyinDictionary.Add("shi", -13658)
    '        PingyinDictionary.Add("shou", -13611)
    '        PingyinDictionary.Add("shu", -13601)
    '        PingyinDictionary.Add("shua", -13406)
    '        PingyinDictionary.Add("shuai", -13404)
    '        PingyinDictionary.Add("shuan", -13400)
    '        PingyinDictionary.Add("shuang", -13398)
    '        PingyinDictionary.Add("shui", -13395)
    '        PingyinDictionary.Add("shun", -13391)
    '        PingyinDictionary.Add("shuo", -13387)
    '        PingyinDictionary.Add("si", -13383)
    '        PingyinDictionary.Add("song", -13367)
    '        PingyinDictionary.Add("sou", -13359)
    '        PingyinDictionary.Add("su", -13356)
    '        PingyinDictionary.Add("suan", -13343)
    '        PingyinDictionary.Add("sui", -13340)
    '        PingyinDictionary.Add("sun", -13329)
    '        PingyinDictionary.Add("suo", -13326)
    '        PingyinDictionary.Add("ta", -13318)
    '        PingyinDictionary.Add("tai", -13147)
    '        PingyinDictionary.Add("tan", -13138)
    '        PingyinDictionary.Add("tang", -13120)
    '        PingyinDictionary.Add("tao", -13107)
    '        PingyinDictionary.Add("te", -13096)
    '        PingyinDictionary.Add("teng", -13095)
    '        PingyinDictionary.Add("ti", -13091)
    '        PingyinDictionary.Add("tian", -13076)
    '        PingyinDictionary.Add("tiao", -13068)
    '        PingyinDictionary.Add("tie", -13063)
    '        PingyinDictionary.Add("ting", -13060)
    '        PingyinDictionary.Add("tong", -12888)
    '        PingyinDictionary.Add("tou", -12875)
    '        PingyinDictionary.Add("tu", -12871)
    '        PingyinDictionary.Add("tuan", -12860)
    '        PingyinDictionary.Add("tui", -12858)
    '        PingyinDictionary.Add("tun", -12852)
    '        PingyinDictionary.Add("tuo", -12849)
    '        PingyinDictionary.Add("wa", -12838)
    '        PingyinDictionary.Add("wai", -12831)
    '        PingyinDictionary.Add("wan", -12829)
    '        PingyinDictionary.Add("wang", -12812)
    '        PingyinDictionary.Add("wei", -12802)
    '        PingyinDictionary.Add("wen", -12607)
    '        PingyinDictionary.Add("weng", -12597)
    '        PingyinDictionary.Add("wo", -12594)
    '        PingyinDictionary.Add("wu", -12585)
    '        PingyinDictionary.Add("xi", -12556)
    '        PingyinDictionary.Add("xia", -12359)
    '        PingyinDictionary.Add("xian", -12346)
    '        PingyinDictionary.Add("xiang", -12320)
    '        PingyinDictionary.Add("xiao", -12300)
    '        PingyinDictionary.Add("xie", -12120)
    '        PingyinDictionary.Add("xin", -12099)
    '        PingyinDictionary.Add("xing", -12089)
    '        PingyinDictionary.Add("xiong", -12074)
    '        PingyinDictionary.Add("xiu", -12067)
    '        PingyinDictionary.Add("xu", -12058)
    '        PingyinDictionary.Add("xuan", -12039)
    '        PingyinDictionary.Add("xue", -11867)
    '        PingyinDictionary.Add("xun", -11861)
    '        PingyinDictionary.Add("ya", -11847)
    '        PingyinDictionary.Add("yan", -11831)
    '        PingyinDictionary.Add("yang", -11798)
    '        PingyinDictionary.Add("yao", -11781)
    '        PingyinDictionary.Add("ye", -11604)
    '        PingyinDictionary.Add("yi", -11589)
    '        PingyinDictionary.Add("yin", -11536)
    '        PingyinDictionary.Add("ying", -11358)
    '        PingyinDictionary.Add("yo", -11340)
    '        PingyinDictionary.Add("yong", -11339)
    '        PingyinDictionary.Add("you", -11324)
    '        PingyinDictionary.Add("yu", -11303)
    '        PingyinDictionary.Add("yuan", -11097)
    '        PingyinDictionary.Add("yue", -11077)
    '        PingyinDictionary.Add("yun", -11067)
    '        PingyinDictionary.Add("za", -11055)
    '        PingyinDictionary.Add("zai", -11052)
    '        PingyinDictionary.Add("zan", -11045)
    '        PingyinDictionary.Add("zang", -11041)
    '        PingyinDictionary.Add("zao", -11038)
    '        PingyinDictionary.Add("ze", -11024)
    '        PingyinDictionary.Add("zei", -11020)
    '        PingyinDictionary.Add("zen", -11019)
    '        PingyinDictionary.Add("zeng", -11018)
    '        PingyinDictionary.Add("zha", -11014)
    '        PingyinDictionary.Add("zhai", -10838)
    '        PingyinDictionary.Add("zhan", -10832)
    '        PingyinDictionary.Add("zhang", -10815)
    '        PingyinDictionary.Add("zhao", -10800)
    '        PingyinDictionary.Add("zhe", -10790)
    '        PingyinDictionary.Add("zhen", -10780)
    '        PingyinDictionary.Add("zheng", -10764)
    '        PingyinDictionary.Add("zhi", -10587)
    '        PingyinDictionary.Add("zhong", -10544)
    '        PingyinDictionary.Add("zhou", -10533)
    '        PingyinDictionary.Add("zhu", -10519)
    '        PingyinDictionary.Add("zhua", -10331)
    '        PingyinDictionary.Add("zhuai", -10329)
    '        PingyinDictionary.Add("zhuan", -10328)
    '        PingyinDictionary.Add("zhuang", -10322)
    '        PingyinDictionary.Add("zhui", -10315)
    '        PingyinDictionary.Add("zhun", -10309)
    '        PingyinDictionary.Add("zhuo", -10307)
    '        PingyinDictionary.Add("zi", -10296)
    '        PingyinDictionary.Add("zong", -10281)
    '        PingyinDictionary.Add("zou", -10274)
    '        PingyinDictionary.Add("zu", -10270)
    '        PingyinDictionary.Add("zuan", -10262)
    '        PingyinDictionary.Add("zui", -10260)
    '        PingyinDictionary.Add("zun", -10256)
    '        PingyinDictionary.Add("zuo", -10254)
    '    End If

    '    GetPinyinDictionary = PingyinDictionary

    'End Function

	Function 条件编译为非调试代码()
		'可以吗？
	End Function

	Function 插入编辑标记()


	End Function
End Module


